﻿@model DeliveryPlus.Web.DAL.Entities.District

@{
    ViewBag.Title = Model.Id <= 0 ? "Создание района":"Редактирование района "+Model.Title;
    Layout = "../Shared/ControlPanelLayout.cshtml";
}

<form role="form" id="article-form" action="/ControlPanel/ManageDistricts/Save" method="POST" enctype="multipart/form-data">
    @Html.HiddenFor(m => m.Id)
    <div class="form-group">
        <label for="news-title-field">Название</label>
        <input type="text" class="form-control" name="Title" id="news-title-field" placeholder="Введите название" value="@Model.Title">
    </div>
    <div class="form-group">
        <label for="news-desc-field">Описание</label>
        <textarea class="form-control" name="Description" placeholder="Введите описание района" id="cafe-desc-field">@Model.Description</textarea>
    </div>
    <button type="submit" class="btn btn-default">Сохранить</button>
</form>
<script type="text/javascript">
    $(document).ready(function() {
        $("#article-form").validate({            
           rules: {
               Title: {
                   required: true,
                   maxlength: 255,
               },
               Description: {
                   required: false,
                   maxlength: 1000,
               }
           } 
        });
    });
</script>
